import React from 'react';
import {
  View,
  Text,
} from 'react-native';



export default class ChatScreen extends React.Component {
    static navigationOptions = {
      title: 'Form2',
    };
    constructor(props){
      super(props);
      this.state = {
        time:0
      }
      setInterval(()=>{
        this.setState(previousState=>{
          return {time:previousState.time+1}
        })
      },1000)
    }
    render() {
      return (
        <View>
          <Text>{this.props.title}</Text>
          <Text>测试state是否刷新{this.state.time}</Text>
        </View>
      );
    }
  }